package com.goodbyegirl1974.cardGameProto.parts
{
	import com.goodbyegirl1974.cardGameProto.config.GameConfig;

	public class BattleParameter
	{
		private static var _instance:BattleParameter;
		
		private var _attack:Attack;
		
		private var _attackKey:String;
		
		private var _hitRatePlusNum:Number;
		
		private var _damagePlusNum:Number;
		
		private var _attackPlusNum:Number;
		
		private var _avoidRate:Number;
		
		private var _avoidRatePlusNum:Number;
		
		private var _result:String = GameConfig.RESULT_NORMAL;
		
		private var _deffencePlayerStatus:String = GameConfig.STATUS_NORMAL;
		
		/**
		 * コンストラクタ
		 * 
		 */		
		public function BattleParameter(block:SingletonBlock)
		{
		}
		
		/**
		 * インスタンスを返す。
		 * @return 
		 * 
		 */		
		public static function getInstance():BattleParameter
		{
			if(BattleParameter._instance == null)
				BattleParameter._instance = new BattleParameter(new SingletonBlock());
			return BattleParameter._instance;
		}
		
		/** 攻撃終了後の、防御側プレーヤーの特殊状態の有無。 */
		public function get deffencePlayerStatus():String
		{
			return _deffencePlayerStatus;
		}

		/**
		 * @private
		 */
		public function set deffencePlayerStatus(value:String):void
		{
			_deffencePlayerStatus = value;
		}

		/** 攻撃結果 */
		public function get result():String
		{
			return _result;
		}

		/**
		 * @private
		 */
		public function set result(value:String):void
		{
			_result = value;
		}

		public function get attackKey():String
		{
			return _attackKey;
		}

		public function set attackKey(value:String):void
		{
			_attackKey = value;
		}

		/** 回避率補正値 */
		public function get avoidRatePlusNum():Number
		{
			return _avoidRatePlusNum;
		}

		/**
		 * @private
		 */
		public function set avoidRatePlusNum(value:Number):void
		{
			_avoidRatePlusNum = value;
		}

		/** 回避率 */
		public function get avoidRate():Number
		{
			return _avoidRate;
		}

		/**
		 * @private
		 */
		public function set avoidRate(value:Number):void
		{
			_avoidRate = value;
		}

		/** 与ダメージ補正値 */
		public function get damagePlusNum():Number
		{
			return _damagePlusNum;
		}

		/**
		 * @private
		 */
		public function set damagePlusNum(value:Number):void
		{
			_damagePlusNum = value;
		}

		/** 攻撃回数補正値 */
		public function get attackPlusNum():Number
		{
			return _attackPlusNum;
		}

		/**
		 * @private
		 */
		public function set attackPlusNum(value:Number):void
		{
			_attackPlusNum = value;
		}

		/** 攻撃命中率補正値 */
		public function get hitRatePlusNum():Number
		{
			return _hitRatePlusNum;
		}

		/**
		 * @private
		 */
		public function set hitRatePlusNum(value:Number):void
		{
			_hitRatePlusNum = value;
		}

		/** 今回の戦闘で使用する攻撃 */
		public function get attack():Attack
		{
			return _attack;
		}

		/**
		 * @private
		 */
		public function set attack(value:Attack):void
		{
			_attack = value;
		}
		
		/**
		 * 処理終了時のリセット。
		 * 
		 */		
		public function reset():void
		{
			this._attack = null;
			this._attackPlusNum = 0.0;
			this._avoidRate = 0.0;
			this._avoidRatePlusNum = 0.0;
			this._damagePlusNum = 0.0;
			this._hitRatePlusNum = 0.0;
			this._result = GameConfig.RESULT_NORMAL;
			this._deffencePlayerStatus = GameConfig.STATUS_NORMAL;
		}
	}
}

class SingletonBlock {}